--dashboard-nvim配置

local status, dashboard = pcall(require, "dashboard")
if not status then
  vim.notify("未找到dashboard-nvim插件")
  return
end

dashboard.setup({
  theme = 'hyper',   -- doom or hyper, default is hyper
  change_to_vcs_root = true,   --打开文件时切换到VCS目录
  shortcut_type = "number",    -- number or letter
  hide = {
    statusline = true,       --是否隐藏状态栏,默认为true
    tabline = true,          --是否隐藏标签页
    winbar = true            --是否隐藏窗口栏
  },
  config = {
    -- week_header = {
    --   enable = true,
    -- },
    packages = {
      enable = true 
    },
    project = { 
      enable = true, 
      limit = 8, 
      icon = '', 
      label = '', 
      action = 'Telescope find_files cwd=' 
    },
    header = {
       '   ⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣤⣴⣶⣶⣶⣶⣶⠶⣶⣤⣤⣀⠀⠀⠀⠀⠀⠀ ',
       ' ⠀⠀⠀⠀⠀⠀⠀⢀⣤⣾⣿⣿⣿⠁⠀⢀⠈⢿⢀⣀⠀⠹⣿⣿⣿⣦⣄⠀⠀⠀ ',
       ' ⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⠿⠀⠀⣟⡇⢘⣾⣽⠀⠀⡏⠉⠙⢛⣿⣷⡖⠀ ',
       ' ⠀⠀⠀⠀⠀⣾⣿⣿⡿⠿⠷⠶⠤⠙⠒⠀⠒⢻⣿⣿⡷⠋⠀⠴⠞⠋⠁⢙⣿⣄ ',
       ' ⠀⠀⠀⠀⢸⣿⣿⣯⣤⣤⣤⣤⣤⡄⠀⠀⠀⠀⠉⢹⡄⠀⠀⠀⠛⠛⠋⠉⠹⡇ ',
       ' ⠀⠀⠀⠀⢸⣿⣿⠀⠀⠀⣀⣠⣤⣤⣤⣤⣤⣤⣤⣼⣇⣀⣀⣀⣛⣛⣒⣲⢾⡷ ',
       ' ⢀⠤⠒⠒⢼⣿⣿⠶⠞⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁⠀⣼⠃ ',
       ' ⢮⠀⠀⠀⠀⣿⣿⣆⠀⠀⠻⣿⡿⠛⠉⠉⠁⠀⠉⠉⠛⠿⣿⣿⠟⠁⠀⣼⠃⠀ ',
       ' ⠈⠓⠶⣶⣾⣿⣿⣿⣧⡀⠀⠈⠒⢤⣀⣀⡀⠀⠀⣀⣀⡠⠚⠁⠀⢀⡼⠃⠀⠀ ',
       ' ⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣷⣤⣤⣤⣤⣭⣭⣭⣭⣭⣥⣤⣤⣤⣴⣟⠁    ',
    },
    -- shortcut = {
    --   {icon = "  ", desc = 'Recently lastest session    ', shortcut = "Leader s l", action = ""},
    --   {icon = "  ", desc = "Recently opened files       ", shortcut = "Leader f h", action = ""},
    --   {icon = "  ", desc = "Find[leader ff]", shortcut = "leader f f", action = ""},
    --   {icon = "  ", desc = "Files[leader f b]", shortcut = "leader f b", action = ""},
    --   {icon = "  ", desc = "Find Word                   ", shortcut = "leader f w", action = ""},
    --   {icon = "  ", desc = "Open Personal dotfiles      ", shortcut = "leader e e", action = "edit $MYVIMRC"}
    -- },
    footer = {

    },
  }
})

dashboard.custom_footer = function()
    local footer = {'', '  Have fun with neovim'}
    if packer_plugins ~= nil then
        local count = #vim.tbl_keys(packer_plugins)
        footer[2] = '  neovim loaded ' .. count .. ' plugins'
        for key, value in pairs(packer_plugins) do
            table.insert(footer, '✨  ' .. key)
        end
    end

    print(footer)
    return footer
end


